
const { Sprite } = Laya;


Sprite.prototype.addEventListener =  function(name, eventProxy, useCapture) {
  // var _name = `${name[0].toLowerCase()}${name.slice(1)}`;
  return this.on(name, this, eventProxy);
};

Sprite.prototype.removeEventListener = function(name, eventProxy, useCapture) {
  // var _name = `${name[0].toLowerCase()}${name.slice(1)}`;
  return this.off(name, this, eventProxy);
};

Sprite.prototype.appendChild = function(dom) {
  return this.addChild(dom);
};

Sprite.prototype.insertBefore = function(newDom, oldDom) {
  var _zOrder = oldDom.zOrder || 1;
  return this.addChildAt(newDom, _zOrder-1);
};



Sprite.prototype.setAttribute = function(name, value) {
  if (!this.dataSource) this.dataSource = {};
  this.dataSource[name] = value;
};